package com.example.demo1.controller;

import com.example.demo1.entity.Score;
import com.example.demo1.service.ScoreService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/scores")
@RequiredArgsConstructor
public class ScoreController {
    
    private final ScoreService scoreService;

    @GetMapping("/{studentId}")
    public ResponseEntity<List<Score>> getStudentScores(@PathVariable Long studentId) {
        List<Score> scores = scoreService.getStudentScores(studentId);
        return ResponseEntity.ok(scores);
    }
} 